fix(converter): de-duplicate skill descriptions in command wrappers#28
Merged
Conversation
Each skill was showing up twice in Claude Code's interactive `/context` skills list: ├ ce-compound-refresh: ~170 tokens ← SKILL.md description ├ ce-lite:ce-compound-refresh: ~60 tokens ← commands/<name>.md description generate_commands.py was carrying a shortened SKILL.md description in every command wrapper's frontmatter. Claude Code counted both — once as a bare-named skill (from SKILL.md), once as a plugin-namespaced command (from commands/<name>.md). For ce-lite's 88 commands, ~6k tokens of duplicated description blurb. Fix: command-wrapper `description:` is now just the skill name itself. Satisfies validate.py's non-empty-description check while collapsing each duplicate entry to ~5 tokens (the bare skill name in the autocomplete namespace). The SKILL.md description is still the canonical routing signal; the command wrapper exists only for `/<plugin>:<name>` dispatch reliability (see generate_commands.py module docstring). Drops `shorten_description` and `MAX_DESCRIPTION_LEN` — no longer used. Tests updated. After merge, trigger publish-dist to regenerate dist/ and re-measure against the README's A/B table. Expected: ce-lite skills slot drops ~12.5k → ~6.5k, total savings vs upstream grows from −105.2k → ~−111k.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Each skill was showing up twice in interactive Claude Code's
/contextskills list:For ce-lite's 88 command wrappers, that's ~6k tokens of duplicated description text.
Root cause
generate_commands.pywas emitting a shortened SKILL.mddescription:into everycommands/<name>.mdfrontmatter. Claude Code counts each as a separate skill entry: bare-named for SKILL.md, plugin-namespaced for the command wrapper.Fix
Command-wrapper
description:is now just the skill name itself (description: "ce-plan"instead ofdescription: "Create structured plans..."). Satisfiesvalidate.py's non-empty-description check while collapsing each duplicate entry to ~5 tokens.The SKILL.md description is still the canonical routing signal. The command wrapper exists only for
/<plugin>:<name>dispatch reliability (seegenerate_commands.pymodule docstring for why command wrappers exist at all).shorten_description+MAX_DESCRIPTION_LENare dropped — no longer used.How this was discovered
Measured interactively in #27's A/B run. The
+7.9kce-lite-side skills bump (ce-lite 12.5k vs upstream 4.6k) was the smoking gun — 88 skills vs upstream's 29 explained part of it, but the +60-token-per-command duplication explained the rest.Expected impact
After merge +
publish-distregen:PR #27's README A/B table will need a refresh in a follow-up.
Test plan
nix flake checkgreen (treefmt + actionlint + 161 pytest)validate.py --upstreambyte-equivalent round-trip still passespublish-distand re-measure with isolatedCLAUDE_CONFIG_DIRs